package _022_2_15

func climbStairs(n int) int {
	arr := make([]int, n+1)

	if n == 0 {
		return 0
	}

	if n == 1 {
		return 1
	}

	if n == 2 {
		return 2
	}

	arr[0] = 0
	arr[1] = 1
	arr[2] = 2

	for i := 0; i < len(arr); i++ {
		arr[i] = arr[i-1] + arr[i-2]
	}

	return arr[len(arr)-1]
}
